package m.member.manage.model;

import m.common.model.DictionaryModel;
import m.common.model.FieldMeta;
import m.common.model.TableMeta;
import m.common.model.type.FieldType;
import m.common.model.util.ModelQueryList;
import manage.model.StatusModel;

import java.util.List;

@TableMeta(name="t_member_level",description="会员级别表")
public class MemberLevel extends StatusModel implements DictionaryModel {
    @FieldMeta(name = "color",type = FieldType.STRING,length=20,description = "颜色",dictType = "color")
    private String color;
    @FieldMeta(name="name",type= FieldType.STRING,length=20,description="会员名称")
    private String name;
    @FieldMeta(name = "discount",type = FieldType.INT,description = "优惠比例%")
    private Integer discount;
    @FieldMeta(name="remark",type= FieldType.STRING,length=500,description="备注")
    private String remark;

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getDiscount() {
        return discount;
    }

    public void setDiscount(Integer discount) {
        this.discount = discount;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String getDictValue() {
        return this.getOid();
    }

    @Override
    public String getDictName() {
        return this.name;
    }

    @Override
    public String getDictParentOid() {
        return "";
    }

    @Override
    public String getDictStatus() {
        return this.getStatus().equals("0")?"Y":"N";
    }

    @Override
    public List<MemberLevel> getCacheList(String s) throws Exception {
        return ModelQueryList.getModelList(MemberLevel.class,"*");
    }
}
